//
//  ShellControlButton.m
//  ShellWallert
//
//  Created by lvzhao on 2019/9/25.
//  Copyright © 2019年  吕VV. All rights reserved.
//

#import "ShellControlButton.h"

@implementation ShellControlButton


- (instancetype)init
{
    self = [super init];
    if (self) {
        
        
    }
    return self;
}

+ (instancetype)buttonWithType:(UIButtonType)buttonType{
    return [super buttonWithType:buttonType];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
}

- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    //获取触摸对象
    UITouch *touche = [touches anyObject];
    //获取touche的位置
    CGPoint point = [touche locationInView:self];
    
    //判断点是否在button中
    if (CGRectContainsPoint(self.bounds, point))
    {
        //执行action
//        [self.target performSelector:self.action withObject:self afterDelay:0];
    }
    
}
- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
}

@end
